Neuridion API Reference

Complete reference for all 37 standard library modules.

Core

Core 🔢Math 💻System 🖥Console

Data & Storage

{ }JSON 📊CSV </>XML 🗃Database 💾Storage .*RegEx

Files & Network

📁FileAndFolder 🌐Network 📦Compression Email

User Interface

🗒Form 📈Chart 🎨Graphics 🖥Screen 📄PDF QRCode

Text & Language

🌏Translate 🔄Encoding 🗣Speech 📋Clipboard

Date, Time & Security

📅DateAndTime 📆Calendar 🔒Crypto

AI, Media & Hardware

🧠AI 🎵Audio 🎷Synth 🔔Notification Hardware 📡Bluetooth 📍Location 👤Contacts 🎨Color Shell

Core

Global functions available without a module prefix.

FunctionParametersReturnsDescription
Print()values...Output text to the console
TypeOf()valueStringGet the type name of a value
Array()items...ArrayCreate an array from arguments
IsNil()valueBooleanCheck if a value is Nil
Core.UUID()StringGenerate a random UUID string

Math

Mathematical functions, constants, and random number generation.

Properties

PropertyTypeDescription
Math.PIDoublePi (3.14159...)
Math.EDoubleEuler's number (2.71828...)
Math.InfinityDoublePositive infinity
Math.NaNDoubleNot a Number

Methods

MethodParametersReturnsDescription
Sqrt(x)numberDoubleSquare root
Sin(x)radiansDoubleSine
Cos(x)radiansDoubleCosine
Tan(x)radiansDoubleTangent
Asin(x)valueDoubleArc sine
Acos(x)valueDoubleArc cosine
Atan(x)valueDoubleArc tangent
Atan2(y, x)y, xDoubleTwo-argument arc tangent
Log(x)numberDoubleNatural logarithm
Log10(x)numberDoubleBase-10 logarithm
Exp(x)numberDoublee raised to x
Pow(base, exp)base, exponentDoublePower
Floor(x)numberDoubleRound down
Ceil(x)numberDoubleRound up
Round(x [, decimals])number [, places]DoubleRound to nearest (optional decimal places)
Abs(x)numberNumberAbsolute value
Min(a, b)a, bNumberSmaller of two
Max(a, b)a, bNumberLarger of two
Sign(x)numberIntegerSign: -1, 0, or 1
Random()DoubleRandom 0.0–1.0
RandomInt(min, max)min, maxIntegerRandom integer in range

System

System information and process control.

Properties

PropertyTypeDescription
System.PlatformStringAlways "macOS"
System.OSVersionStringmacOS version string
System.UserNameStringCurrent user name

Methods

MethodParametersReturnsDescription
Sleep(ms)millisecondsPause execution
Exit([code])[exit code]Terminate the program
Environment(name)variable nameStringRead environment variable
CurrentTimeMillis()IntegerMilliseconds since epoch

Console

Console I/O for reading input and writing formatted output.

MethodParametersReturnsDescription
Write(values...)valuesPrint without newline
WriteLine(values...)valuesPrint with newline
Error(msg)messagePrint [ERROR] message (red)
Warn(msg)messagePrint [WARN] message (orange)
Info(msg)messagePrint [INFO] message (blue)
Debug(msg)messagePrint [DEBUG] message (gray)
Table(data)2D arrayPrint formatted table
ReadLine([prompt])[prompt text]StringRead user input
Clear()Clear console output

JSON

Parse, create, and manipulate JSON data.

MethodParametersReturnsDescription
Parse(text)JSON stringObject/ArrayParse JSON string to value
Stringify(value [, pretty])value [, Boolean]StringConvert value to JSON string
IsValid(text)stringBooleanCheck if string is valid JSON
Format(text)JSON stringStringPretty-print JSON
ReadFile(path)file pathObject/ArrayLoad and parse a JSON file
WriteFile(path, value [, pretty])path, value [, Bool]Write value as JSON to file

CSV

Read and write CSV (Comma-Separated Values) data.

MethodParametersReturnsDescription
Parse(text [, delimiter])CSV string [, separator]ArrayParse CSV string to 2D array
Read(path [, delimiter])file path [, separator]ArrayRead CSV file to 2D array
Write(path, data [, delimiter])path, 2D array [, separator]Write 2D array to CSV file
ToString(data [, delimiter])2D array [, separator]StringConvert 2D array to CSV string

XML

Parse, create, and manipulate XML documents.

MethodParametersReturnsDescription
ParseString(text)XML stringXmlDocumentParse XML string
LoadFromFile(path)file pathXmlDocumentLoad XML from file
Create(rootName)root element nameXmlDocumentCreate new XML document

XmlDocument Object

MethodReturnsDescription
.GetRootElement()XmlElementGet the root element
.ToString()StringSerialize to XML string
.SaveToFile(path)Save to file

XmlElement Object

Method/PropertyReturnsDescription
.NameStringElement tag name
.TextContentStringText content
.GetChildren()ArrayGet child elements
.GetChildByName(name)XmlElementFind child by tag name
.GetAttribute(name)StringGet attribute value
.SetAttribute(name, value)Set attribute
.SetTextContent(text)Set text content
.AddChild(element)Append child element
.RemoveChild(element)Remove child element

Database

SQLite database access.

MethodParametersReturnsDescription
Open(path)file pathConnectionOpen or create a SQLite database
InMemory()ConnectionCreate in-memory database

Connection Object

MethodParametersReturnsDescription
.Execute(sql, params...)SQL [, values]IntegerExecute SQL, return affected rows
.Query(sql, params...)SQL [, values]ArrayQuery and return rows as array of objects
.Scalar(sql, params...)SQL [, values]ValueReturn first column of first row
.Close()Close the connection
.TableExists(name)table nameBooleanCheck if table exists
.LastInsertId()IntegerLast inserted row ID
.Changes()IntegerRows changed by last statement

Storage

Persistent key-value storage (per project).

MethodParametersReturnsDescription
Set(key, value)key, valueStore a value
Get(key)keyValueRetrieve a stored value
Has(key)keyBooleanCheck if key exists
Remove(key)keyDelete a stored value
GetAll()ObjectGet all key-value pairs
Clear()Delete all stored values

RegEx

Regular expression matching and manipulation.

MethodParametersReturnsDescription
IsMatch(pattern, text)pattern, textBooleanTest if text matches pattern
Match(pattern, text)pattern, textArrayReturn all matches
Replace(pattern, text, replacement)pattern, text, replacementStringReplace matches
Split(pattern, text)pattern, textArraySplit text by pattern
Escape(text)textStringEscape special regex characters

FileAndFolder

File system operations: read, write, copy, move, and browse files and folders.

Properties

PropertyDescription
HomeDirectoryUser home directory
TempDirectoryTemporary directory
DesktopDirectoryDesktop path
DocumentsDirectoryDocuments path
DownloadsDirectoryDownloads path
CurrentDirectoryCurrent working directory

Methods

MethodParametersReturnsDescription
ReadFile(path)pathStringRead entire file as text
WriteFile(path, text)path, contentWrite text to file
AppendLine(path, text)path, lineAppend a line to file
FileExists(path)pathBooleanCheck if file exists
DeleteFile(path)pathDelete a file
CopyFile(src, dst)source, destinationCopy a file
MoveFile(src, dst)source, destinationMove a file
RenameFile(path, newName)path, new nameRename a file
GetFileSize(path)pathIntegerFile size in bytes
Open(path)pathFileHandleOpen file for read/write
CreateFolder(path)pathCreate directory
DeleteFolder(path)pathDelete directory
FolderExists(path)pathBooleanCheck if folder exists
ListFiles(path)directory pathArrayList files in directory
ListFolders(path)directory pathArrayList subdirectories
ListAll(path)directory pathArrayList all items
GetFileName(path)pathStringExtract file name
GetExtension(path)pathStringExtract file extension
GetDirectory(path)pathStringExtract parent directory
Combine(path1, path2)base, relativeStringJoin paths
ChooseFile([filter])[extension filter]StringShow file picker dialog
ChooseFolder()StringShow folder picker dialog

FileHandle Object

Method/PropertyReturnsDescription
.PathStringFile path
.IsOpenBooleanWhether file is open
.ReadAll()StringRead entire file
.ReadLine()StringRead next line
.Write(text)Write text (overwrite)
.Append(text)Append text
.Close()Close the file

Network

HTTP requests, TCP connections, and sessions.

MethodParametersReturnsDescription
Get(url [, headers])URL [, Object]ResponseHTTP GET request
Post(url, body [, headers])URL, body [, Object]ResponseHTTP POST request
Put(url, body [, headers])URL, body [, Object]ResponseHTTP PUT request
Delete(url [, headers])URL [, Object]ResponseHTTP DELETE request
Download(url, path)URL, file pathBooleanDownload file to disk
Session()SessionCreate persistent session
TCP.Connect(host, port [, timeout])host, port [, seconds]TCPConnectionOpen TCP connection

Response Object

PropertyTypeDescription
.StatusCodeIntegerHTTP status code
.BodyStringResponse body
.OKBooleanTrue if 200-299
.HeadersObjectResponse headers

Compression

Zip/unzip files and folders.

MethodParametersReturnsDescription
ZipFolder(folder, zipPath)source folder, output zipBooleanCompress a folder
ZipFile(file, zipPath)source file, output zipBooleanCompress a single file
Unzip(zipPath, folder)zip file, output folderBooleanExtract entire archive
UnzipFile(zipPath, fileName, outPath)zip, file name, outputBooleanExtract single file
ListArchiveContent(zipPath)zip fileArrayList files in archive
CompressBytes(data [, algo])string [, algorithm]StringCompress data in memory
DecompressBytes(data [, algo])string [, algorithm]StringDecompress data in memory

Email

Send and receive email via SMTP and IMAP.

MethodParametersReturnsDescription
Send(to, subject, body [, from, html])to, subject, body [, from, html]BooleanSend email via SMTP
Create()MailCreate composable email
SMTP(host, port, user, pass)credentialsSMTPCreate SMTP connection
IMAP(host, port, user, pass)credentialsIMAPCreate IMAP connection

Mail Object

Property/MethodDescription
.From, .To, .CC, .BCCAddress fields
.Subject, .Body, .HTMLContent fields
.AddAttachment(path)Attach a file
.Send()Send the email

Form

Create native macOS windows and dialogs with controls, shapes, and callbacks.

MethodParametersReturnsDescription
Window(title, width, height [, options])title, w, h [, Object]FormWindowCreate a form window
InputBox(prompt [, title [, default]])String [, String [, String]]StringSimple input dialog
MsgBox(message [, title [, style]])String [, String [, Integer]]IntegerMessage dialog

FormWindow Controls

All controls use unified signature: Add*(name, x, y [, {options}]). Content (text, items, value) goes into the options dict.

MethodKey OptionsDescription
.AddLabel()"Text", "FontSize", "FontBold"Static text label
.AddButton()"Text", "Style", "OnClick", "OnRightClick"Clickable button
.AddTextField()"Text", "Placeholder", "Password", "OnChange", "OnFocus", "OnBlur"Single-line text input
.AddTextArea()"Text", "OnChange", "OnFocus", "OnBlur"Multi-line text input
.AddCheckBox()"Text", "Checked", "OnChange"Checkbox toggle
.AddRadioButton()"Text", "Selected", "OnChange"Radio button
.AddComboBox()"Items", "OnChange"Dropdown selection
.AddListBox()"Items", "OnChange", "OnDoubleClick", "OnSelect"Scrollable list
.AddProgressBar()"Value"Progress indicator
.AddSlider()"Value", "OnChange"Slider control
.AddTable()"Data", "HasHeaders", "Editable", "OnDoubleClick", "OnSelect"Data table
.AddCanvas()"Image", "SystemImage", "OnClick", "OnMouseMove", "OnPaint", "OnRightClick"Image/drawing canvas
.AddGroupBox()"Text"Group container
.AddTabControl()"Tabs", "Position", "SelectedTab", "OnChange", "OnDoubleClick", "OnRightClick"Tab container with named tabs
.AddSeparator()"Width"Horizontal separator
.AddDatePicker()"Value", "Style", "Mode", "MinDate", "MaxDate", "OnChange", "OnClick", "OnDoubleClick", "OnRightClick"Date/time picker
.AddToolbar()"Items", "Style"Native macOS toolbar in window title bar

ForegroundColor Option

All text controls (Label, Button, TextField, TextArea, CheckBox, RadioButton) support an optional "ForegroundColor" option to set the text color:

win.AddLabel("lbl", 10, 10, {"Text": "White text", "ForegroundColor": Color.RGB(255, 255, 255)})

Also settable at runtime via GetControl: win.GetControl("lbl").ForegroundColor = Color.RGB(255, 0, 0)

DatePicker Control

Native date/time picker that integrates with the DateAndTime module:

// Compact date picker (default)
win.AddDatePicker("dp1", 10, 50, {"Value": DateAndTime.Now(), "Style": "Compact"})

// Calendar popup picker
win.AddDatePicker("dp2", 10, 80, {"Value": DateAndTime.Create(2026, 1, 1), "Style": "Calendar"})

// Time-only picker
win.AddDatePicker("dp3", 10, 110, {"Mode": "Time"})
// Date+Time picker
win.AddDatePicker("dp4", 10, 140, {"Mode": "DateTime"})
OptionTypeDescription
"Value"DateAndTime objectInitial date value (default: current date)
"Style"String"Compact" (text field + stepper, default) or "Calendar" (graphical calendar)
"Mode"String"Date" (default), "DateTime", or "Time"
"MinDate"DateAndTime objectMinimum selectable date
"MaxDate"DateAndTime objectMaximum selectable date
"OnChange"FunctionFires when date changes. event["Value"] = DateAndTime object
"OnClick"FunctionFires on click. event["Value"] = current DateAndTime object
"OnDoubleClick"FunctionFires on double-click. event["Value"] = current DateAndTime object
"OnRightClick"FunctionFires on right-click

GetControl returns a DateAndTime object for .Value: Var date As Object = win.GetControl("dp1").Value — with Year, Month, Day, Hour, Minute, Second, Format() etc.

TabControl

A tabbed container that organizes controls into switchable tab pages. Returns an object with its own Add*() methods for placing controls inside specific tabs.

Var tabs As Object = app.AddTabControl("tabs", 10, 10, {
    "Tabs": ["General", "Advanced", "About"],
    "Width": 400, "Height": 300,
    "OnChange": onTabChanged
})

// Add controls to specific tabs using the "Tab" option (0-based index)
tabs.AddLabel("lblName", 10, 10, {"Text": "Name:", "Tab": 0})
tabs.AddTextField("txtName", 80, 8, {"Width": 200, "Tab": 0})

tabs.AddCheckBox("chkDebug", 10, 10, {"Text": "Debug Mode", "Tab": 1})
tabs.AddSlider("sldSpeed", 10, 40, {"Value": 50, "Tab": 1})

tabs.AddLabel("lblVersion", 10, 10, {"Text": "Version 1.0", "Tab": 2})
OptionTypeDescription
"Tabs"ArrayArray of tab names (strings)
"Position"StringTab header position: "Top" (default), "Bottom", "Left", "Right", "None"
"SelectedTab"IntegerInitially selected tab index (0-based, default: 0)
"OnChange"FunctionFires when tab is switched. event["Value"] = new tab index, event["TabIndex"] = index, event["TabName"] = tab label
"OnDoubleClick"FunctionFires on double-click on a tab header. event["TabIndex"] = index, event["TabName"] = tab label
"OnRightClick"FunctionFires on right-click on a tab header. event["TabIndex"] = index, event["TabName"] = tab label
"Tab"IntegerOn child controls: which tab page to place the control on (0-based)

Child controls use tab-relative coordinates (x/y relative to the tab content area, not the window). Access child controls normally via win.GetControl("txtName"). Set the active tab programmatically: win.GetControl("tabs").SelectedTab = 2

Toolbar

Adds a native macOS toolbar to the window title bar. The toolbar appears in the standard macOS position (integrated into the title bar area) and supports buttons, search fields, separators, and flexible spaces.

Note: AddToolbar uses a special signature: AddToolbar(name, {options}) — no x/y coordinates since the toolbar is always in the title bar.

Var app As Object = Form.Window("My App", 600, 400)

Function onNew(sender As Object, event As Object)
    Print("New clicked!")
End Function

Function onSearch(sender As Object, event As Object)
    Print($"Search: {event["Value"]}")
End Function

app.AddToolbar("toolbar", {
    "Items": [
        {"Name": "new", "Label": "New", "Icon": "plus", "Type": "button", "OnClick": onNew},
        {"Name": "save", "Label": "Save", "Icon": "square.and.arrow.down", "Type": "button", "OnClick": onSave},
        "separator",
        "flexibleSpace",
        {"Name": "search", "Label": "Search", "Type": "search", "Placeholder": "Search...", "OnChange": onSearch}
    ],
    "Style": "unified"
})
app.Show()
OptionTypeDescription
"Items"ArrayArray of toolbar item definitions (dicts or strings)
"Style"String"unified" (default), "unifiedCompact", or "expanded"

Item types:

TypeKeysDescription
"button"Name, Label, Icon, OnClickClickable toolbar button with SF Symbol icon
"search"Name, Label, Placeholder, OnChangeSearch field (NSSearchToolbarItem)
"separator"Use the string "separator" in the Items array
"flexibleSpace"Use the string "flexibleSpace" to push items to the right

Toolbar button clicks fire with event["Value"] = item name. Search field changes fire with event["Value"] = current search text.

Context Menu

Any control can have a right-click context menu. Add a "ContextMenu" option to the control's options dict with an array of menu items:

Function onCopy(sender As Object, event As Object)
    Print($"Copy from {event["Control"]}")
End Function

Function onDelete(sender As Object, event As Object)
    Print("Delete!")
End Function

app.AddLabel("lbl", 10, 10, {
    "Text": "Right-click me!",
    "ContextMenu": [
        {"Text": "Copy", "Icon": "doc.on.doc", "OnClick": onCopy},
        {"Text": "Paste", "Icon": "doc.on.clipboard", "OnClick": onPaste},
        "-",
        {"Text": "Delete", "Icon": "trash", "OnClick": onDelete}
    ]
})
KeyTypeDescription
"Text"StringMenu item label
"Icon"StringSF Symbol name (optional)
"OnClick"FunctionCallback when item is clicked
"-"StringUse the string "-" as a separator between items

Context menu callbacks receive event["Event"] = "ContextMenu", event["Value"] = menu item text, and event["Control"] = control name.

Shapes

All shapes use the same signature: Add*(name, x, y [, {options}]). Support FillColor, Gradient, Shadow, and OnClick callbacks.

MethodKey OptionsDescription
.AddRectangle()"Width", "Height", "FillColor", "CornerRadius", "Gradient", "Shadow", "OnClick", "OnRightClick"Filled rectangle
.AddCircle()"Radius", "FillColor", "Gradient", "Shadow", "OnClick", "OnRightClick"Filled circle
.AddLine()"ToX", "ToY", "Color", "Width", "Style"Line (no OnClick)

Window Methods

MethodReturnsDescription
.Show()ObjectShow window — modal if no callbacks, callback dispatch loop if any OnClick/OnChange
.Close()Close the window (call from callbacks to end dispatch loop)
.GetControl(name)ControlGet live control reference for property updates
.SetTimer(name, ms, callback)Start a named repeating timer. Callback fires every ms milliseconds
.ClearTimer(name)Stop and remove a named timer

Timers

Use SetTimer / ClearTimer to run code periodically while the window is open. Timer callbacks run on the interpreter thread, same as UI callbacks — no threading issues. All timers are automatically stopped when the window closes.

Function onTick(sender As Object, event As Object)
    app.GetControl("lblClock").Text = DateAndTime.Now().Format("HH:mm:ss")
End Function

// Update clock every second
app.SetTimer("clock", 1000, onTick)

// Stop the timer later
app.ClearTimer("clock")

Multiple timers can run simultaneously with different names and intervals. Replacing an existing timer (same name) automatically cancels the old one.

Multi-Window Support

Open multiple windows simultaneously. Call Form.Window() + Show() from inside a callback to open a secondary window. The first Show() blocks the interpreter; subsequent calls from callbacks register the new window and return immediately. All windows share a single event dispatch loop — callbacks from any window run on the same interpreter thread.

Var app As Object = Form.Window("Main Window", 500, 300)

Function openDetail(sender As Object, event As Object)
    Var detail As Object = Form.Window("Detail", 300, 200)
    detail.AddLabel("lbl", 15, 15, {"Text": "This is a second window!"})
    detail.AddButton("btnOK", 15, 50, {
        "Text": "Close Detail", "OnClick": onCloseDetail
    })
    detail.Show()  // Does NOT block — registers into the shared event loop
End Function

Function onCloseDetail(sender As Object, event As Object)
    // Find the detail window via a variable and close it
    detail.Close()
End Function

app.AddButton("btnOpen", 15, 15, {
    "Text": "Open Detail Window", "OnClick": openDetail
})
app.Show()  // Blocks until ALL windows are closed

Rules:

GetControl Properties

win.GetControl(name) returns a live control reference. Read and write properties at runtime:

PropertyTypeRead/WriteDescription
.TextStringR/WText content (Label, Button, TextField, TextArea, ComboBox)
.ValueDouble / DateR/WNumeric value (Slider, ProgressBar) or DateAndTime object (DatePicker)
.ItemsArrayWUpdate items list (ComboBox, ListBox, Table via 2D array)
.EnabledBooleanR/WEnable or disable a control
.VisibleBooleanR/WShow or hide a control
.SelectedRowIntegerR/WSelected row index for Table and ListBox (-1 = none). Set to programmatically select a row
.SelectedBooleanWCheck/uncheck state for CheckBox, RadioButton
.PlaceholderStringWPlaceholder text for TextField
.FontSizeDoubleWFont size (Label, TextField, TextArea)
.FontBoldBooleanWBold font (Label)
.IconStringWSF Symbol name (Button)
.ImagePicture/StringWImage from Picture object or file path (Canvas)
.ForegroundColorColorWText color (Label, Button, TextField, TextArea)
.SelectedTabIntegerR/WActive tab index for TabControl (0-based)
// Select the first row in a table
app.GetControl("tblContacts").SelectedRow = 0

// Read selected row
Var row As Integer = app.GetControl("tblContacts").SelectedRow

// Deselect all rows
app.GetControl("tblContacts").SelectedRow = -1

Dialog Methods

Native macOS alert dialogs for quick user interaction:

MethodParametersReturnsDescription
Form.Alert(message [, title])String, StringShow an informational message with OK button
Form.Confirm(message [, title])String, StringBooleanShow OK/Cancel dialog, returns True if OK clicked
Form.Ask(message, buttons [, title])String, Array, StringStringShow dialog with custom buttons, returns clicked button text
// Simple alert
Form.Alert("Contact saved successfully.")

// Confirm dialog
If Form.Confirm("Delete this contact?", "Confirm Delete") Then
    db.Execute("DELETE FROM contacts WHERE id = ?", id)
End If

// Custom choice
Var choice As String = Form.Ask("Unsaved changes.", ["Save", "Discard", "Cancel"])
If choice = "Save" Then
    saveData()
End If

Events & Callbacks

Add event callbacks to the options dict with a function reference. Callback signature: Function handler(sender As Object, event As Object).

sender: Name, Type, Value (plus all field values). event: Event, Control, Value. Shapes/Canvas also get X, Y (local coordinates).

Control Events

EventFires whenControlsevent["Value"]
OnClickControl is clickedButton, Label, Canvas, Rectangle, CircleButton text, or null (shapes get X, Y)
OnChangeValue changes (text fields: on blur)TextField, TextArea, CheckBox, RadioButton, ComboBox, ListBox, SliderCurrent value (text, boolean, double, or row index)
OnDoubleClickRow is double-clickedListBox, TableClicked row index (Integer)
OnSelectSelection changesListBox, TableSelected row index (Integer, -1 if none)
OnFocusControl receives keyboard focusTextField, TextAreaCurrent text content
OnBlurControl loses keyboard focusTextField, TextAreaCurrent text content
OnRightClickRight mouse button clickedButton, Canvas, Rectangle, Circlenull (shapes/canvas get X, Y)
OnMouseMoveMouse moves over controlCanvasnull (get X, Y from event)
OnPaintCanvas needs redrawingCanvas

Window Events

Set window events as properties: win.OnLoad = myFunction

EventFires whenDescription
OnLoadWindow is displayedFires once after Show() — use to initialize controls or load data
OnCloseWindow is closingFires when the window close button is pressed — use for cleanup
OnResizeWindow is resizedFires when the user resizes the window — use to reposition controls

Chart

Create bar, line, pie, and scatter charts.

MethodParametersReturnsDescription
Bar(labels, values)Array, ArrayChartObjectCreate bar chart
Line(labels, values)Array, ArrayChartObjectCreate line chart
Pie(labels, values)Array, ArrayChartObjectCreate pie chart
Scatter(labels, values)Array, ArrayChartObjectCreate scatter chart

ChartObject

Property/MethodDescription
.TitleChart title (read/write)
.SetSize(w, h)Set chart dimensions
.SetColor(r, g, b)Set chart color (RGB integers 0–255)
.Show()Display in a window
.SaveToFile(path)Save chart as PNG
.ToPicture()Convert to Picture object

Graphics

Create and manipulate images with drawing operations.

MethodParametersReturnsDescription
CreatePicture(width, height [, transparent])width, height, transparent (optional Boolean)PictureCreate a blank image. Default: white background. If transparent is True, the background is transparent (for overlays)

Picture Object

MethodParametersDescription
.DrawRectangle(x, y, w, h)x, y, width, heightDraw rectangle outline
.FillRectangle(x, y, w, h)x, y, width, heightFill rectangle
.DrawEllipse(x, y, w, h)x, y, width, heightDraw ellipse outline
.FillEllipse(x, y, w, h)x, y, width, heightFill ellipse
.DrawLine(x1, y1, x2, y2)start x/y, end x/yDraw a line
.DrawText(text, x, y)text, x, yDraw text
.DrawPicture(pic, x, y)picture, x, yOverlay another picture
.SetColor(color)Color or r,g,bSet stroke color
.SetFillColor(color)Color or r,g,bSet fill color
.SetLineWidth(w)widthSet line thickness
.SetFont(name, size)font name, sizeSet text font
.SaveToFile(path)file pathSave as PNG
.ToPicture()Get as Picture value
.DetectText([lang])[language]Detect text via Vision (AI)
.DetectObjects()Detect objects via Vision (AI)
.DetectFaces()Detect faces via Vision (AI)

Screen

Screen information, mouse position, and screenshots.

MethodParametersReturnsDescription
Width()IntegerMain screen width
Height()IntegerMain screen height
ScaleFactor()DoubleRetina scale factor
DarkMode()BooleanIs dark mode active
Displays()ArrayAll connected displays
MouseX()IntegerMouse X position
MouseY()IntegerMouse Y position
Screenshot()PictureCapture entire screen
ScreenshotRegion(x, y, w, h)x, y, w, hPictureCapture screen region
ScreenshotToFile(path)file pathBooleanSave screenshot to file
PixelColor(x, y)x, yColorGet pixel color

PDF

Create and manipulate PDF documents.

MethodParametersReturnsDescription
Create([width, height])[w, h]PDFCreate new PDF
Open(path)file pathPDFOpen existing PDF

PDF Object

MethodParametersDescription
.AddPage([w, h])[width, height]Add a new page
.SetFont(name, size)font, sizeSet text font
.DrawText(x, y, text)x, y, textDraw text on page
.SaveToFile(path)pathSave PDF to file
.AddPageNumbers([format])[format]Add page numbers

QRCode

Generate and read QR codes.

MethodParametersReturnsDescription
Generate(text [, size])content [, pixel size]PictureGenerate QR code image
Read(picture)pictureStringRead QR code from Picture object

Translate

Text translation using Apple Translation or MyMemory API.

MethodParametersReturnsDescription
Text(text, targetLang [, sourceLang])text, target lang [, source lang]StringTranslate text (source language is optional)
DetectLanguage(text)textStringDetect language of text
DetectLanguages(text [, count])text [, max results]ArrayDetect multiple possible languages

Encoding

Base64, hex, URL encoding, and number base conversions.

MethodParametersReturnsDescription
Base64Encode(text)textStringEncode to Base64
Base64Decode(text)Base64 stringStringDecode from Base64
HexEncode(text)textStringEncode to hex
HexDecode(text)hex stringStringDecode from hex
URLEncode(text)textStringURL-encode text
URLDecode(text)encoded textStringURL-decode text
HTMLEscape(text)textStringEscape HTML entities
HTMLUnescape(text)textStringUnescape HTML entities
ToBinary(n)integerStringConvert to binary string
FromBinary(text)binary stringIntegerParse binary string
ToOctal(n)integerStringConvert to octal
FromOctal(text)octal stringIntegerParse octal string
ToHex(n)integerStringConvert to hex
FromHex(text)hex stringIntegerParse hex string
ToBase(n, base)number, baseStringConvert to arbitrary base
FromBase(text, base)string, baseIntegerParse from arbitrary base
Char(code)ASCII codeStringCharacter from code point
ASCII(char)characterIntegerCode point of character

Speech

Text-to-speech using the system voice.

MethodParametersReturnsDescription
Say(text [, voice])text [, voice name]Speak text aloud
GetVoices()ArrayList available voices
SetVoice(name)voice nameSet default voice
SetRate(rate)speed (0–300)Set speech rate
Stop()Stop speaking

Clipboard

System clipboard access.

MethodParametersReturnsDescription
GetText()StringRead clipboard text
SetText(text)textCopy text to clipboard
HasText()BooleanCheck if clipboard has text
Clear()Clear clipboard

DateAndTime

Date and time creation, formatting, and arithmetic.

MethodParametersReturnsDescription
Now()DateCurrent date and time
Today()DateToday at midnight
Timestamp()IntegerUnix timestamp (seconds)
TimestampMillis()IntegerUnix timestamp (milliseconds)
Create(y, m, d [, h, min, s])year, month, day [, ...]DateCreate specific date
Parse(text, format)string, formatDateParse date from string
DaysBetween(d1, d2)date, dateIntegerDays between two dates
SecondsBetween(d1, d2)date, dateIntegerSeconds between two dates
IsLeapYear(year)yearBooleanCheck if leap year
DaysInMonth(year, month)year, monthIntegerDays in given month

Date Object

Property/MethodTypeDescription
.Year, .Month, .DayIntegerDate components
.Hour, .Minute, .SecondIntegerTime components
.DayOfWeekIntegerDay of week (1=Sun)
.DayOfWeekNameStringDay name (e.g. "Monday")
.MonthNameStringMonth name (e.g. "January")
.AddDays(n)DateAdd days
.AddHours(n)DateAdd hours
.AddMinutes(n)DateAdd minutes
.AddMonths(n)DateAdd months
.AddYears(n)DateAdd years
.Format(fmt)StringFormat as string (e.g. "yyyy-MM-dd")
.ToString()StringDefault string representation

Calendar

Access macOS Calendar events and Reminders.

MethodParametersReturnsDescription
Today()ArrayToday's events
Events(from, to)start date, end dateArrayEvents in date range
NextEvent()EventNext upcoming event
Busy(date)dateBooleanCheck if date has events
CreateEvent(options)ObjectEventCreate a calendar event
DeleteEvent(event)eventBooleanDelete an event
List()ArrayList all calendars
Reminders()ArrayGet all reminders
CreateReminder(options)ObjectReminderCreate a reminder

Crypto

Cryptographic hashing, HMAC, and encryption.

MethodParametersReturnsDescription
SHA256(text)textStringSHA-256 hash
SHA384(text)textStringSHA-384 hash
SHA512(text)textStringSHA-512 hash
HMAC_SHA256(text, key)text, keyStringHMAC-SHA256
HMAC_SHA512(text, key)text, keyStringHMAC-SHA512
VerifyHMAC(text, key, hash)text, key, expectedBooleanVerify HMAC
GenerateKey()StringGenerate AES-GCM key
Encrypt(text, key)plaintext, keyStringAES-GCM encrypt
Decrypt(text, key)ciphertext, keyStringAES-GCM decrypt
EncryptChaCha(text, key)plaintext, keyStringChaCha20-Poly1305 encrypt
DecryptChaCha(text, key)ciphertext, keyStringChaCha20-Poly1305 decrypt
RandomToken(length)byte lengthStringRandom hex token
HashFile(path)file pathStringSHA-256 hash of file

AI

AI text generation via Apple Intelligence, Claude, Google, or OpenAI.

MethodParametersReturnsDescription
Apple()AppleAIApple Intelligence (on-device)
Claude([apiKey [, model]])[key, model]ClaudeAIAnthropic Claude
Google([apiKey [, model]])[key, model]GoogleAIGoogle Gemini
OpenAI([apiKey [, model]])[key, model]OpenAIOpenAI GPT

AI Provider Object

MethodParametersReturnsDescription
.Generate(prompt)prompt textStringGenerate text
.GenerateWith(system, prompt)system prompt, user promptStringGenerate with system instruction
.Summarize(text)textStringSummarize text
.Translate(text, lang)text, target languageStringTranslate text
.IsAvailable()BooleanCheck availability (Apple only)

Audio

Audio playback and recording.

MethodParametersReturnsDescription
LoadSound(path)file pathAudioPlayerLoad audio file
StartRecording(path)output pathAudioRecorderStart recording audio

AudioPlayer Object

Method/PropertyDescription
.Play()Start playback
.Pause()Pause playback
.Resume()Resume playback
.Stop()Stop playback
.Seek(seconds)Seek to position
.SetVolume(level)Set volume (0.0–1.0)
.SetLooping(bool)Enable/disable looping
.GetDuration()Get total duration
.GetPosition()Get current position
.Release()Release resources
.IsPlayingWhether currently playing
.DurationTotal duration in seconds

Synth

Synthesizer for generating tones and sounds.

MethodParametersReturnsDescription
PlayNote(freq [, duration])frequency [, seconds]Play a single note
PlaySequence(notes, duration)freq array, secondsPlay a sequence of notes
SweepUp(startHz, endHz, duration)start freq, end freq, secondsPlay ascending frequency sweep
SweepDown(startHz, endHz, duration)start freq, end freq, secondsPlay descending frequency sweep
Noise(duration)secondsPlay white noise
Stop()Stop all playback
SetVolume(level)volume (0.0–1.0)Set output volume
SetAttack(seconds)secondsSet attack time
SetDecay(seconds)secondsSet decay time
SetSustain(level)level (0.0–1.0)Set sustain level
SetRelease(seconds)secondsSet release time

Notification

macOS system notifications.

MethodParametersReturnsDescription
Send(title, message [, sound])title, body [, sound name]Show system notification
SendWithSubtitle(title, subtitle, msg)title, subtitle, bodyNotification with subtitle

Hardware

System hardware information.

MethodParametersReturnsDescription
CPU()ObjectCPU info (Model, Cores, PhysicalCores)
Memory()ObjectRAM info (Total, Available, Used, Pressure)
Battery()ObjectBattery (Level, IsCharging, PowerSource, CycleCount)
Disk()ObjectBoot disk (Total, Free, Used)
DiskFor(path)pathObjectDisk info for path
Uptime()IntegerSystem uptime in seconds
ThermalState()StringThermal state (Nominal/Fair/Serious/Critical)
MacModel()StringMac model identifier
Displays()ArrayConnected displays

Bluetooth

Bluetooth Low Energy (BLE) device scanning and communication.

MethodParametersReturnsDescription
IsAvailable()BooleanCheck if Bluetooth is on
Scan(seconds)durationArrayScan for BLE devices
Connect(device)device objectConnectionConnect to device
Disconnect(connection)connectionBooleanDisconnect from device

Connection Object

MethodParametersDescription
.Discover()Discover services & characteristics
.Read(serviceUUID, charUUID)UUIDsRead characteristic value (hex)
.Write(serviceUUID, charUUID, hex)UUIDs, hex dataWrite to characteristic
.Disconnect()Disconnect

Location

GPS location and geocoding.

MethodParametersReturnsDescription
Current()LocationGet current GPS location
SearchAddress(address)address stringLocationGeocode address to coordinates
SearchCoordinates(lat, lon)lat, lonLocationReverse geocode
DistanceBetween(lat1, lon1, lat2, lon2)coordsDoubleDistance in meters
BearingBetween(lat1, lon1, lat2, lon2)coordsDoubleBearing in degrees

Contacts

Access macOS Contacts.

MethodParametersReturnsDescription
Search(query)search textArraySearch contacts by name
SearchByEmail(email)emailArrayFind by email
SearchByPhone(phone)phoneArrayFind by phone
All()ArrayGet all contacts
Count()IntegerTotal number of contacts
Create(firstName, lastName)first, lastContactCreate a new contact
Groups()ArrayList contact groups
VCard(contact)contactStringExport as vCard

Color

Color creation and manipulation.

Preset Colors

Color.Red, Color.Green, Color.Blue, Color.White, Color.Black, Color.Yellow, Color.Orange, Color.Purple, Color.Cyan, Color.Magenta, Color.Gray, Color.Pink, Color.Brown, Color.Gold, Color.Silver, Color.Navy, Color.Teal, Color.Coral

Methods

MethodParametersReturnsDescription
RGB(r, g, b)0–255 eachColorCreate from RGB
RGBA(r, g, b, a)0–255, alpha 0–1ColorCreate from RGBA
Hex(hex)hex stringColorCreate from hex (e.g. "#FF0000")
HSL(h, s, l)hue, saturation, lightnessColorCreate from HSL
Mix(c1, c2)color, colorColorMix two colors
Lighten(color, amount)color, 0–1ColorLighten a color
Darken(color, amount)color, 0–1ColorDarken a color

Shell

Execute system commands.

MethodParametersReturnsDescription
Execute(command)command stringObjectRun shell command; returns {Output, ErrorOutput, ExitCode}